package org.snail.po.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.snail.exception.JsonResult;
import org.snail.po.bean.PoAttributeDO;
import org.snail.po.bean.PoCondition;
import org.snail.po.mapper.PoAttributeMapper;
import org.snail.po.service.PoAttributeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class PoAttributeServiceImpl implements PoAttributeService {

    @Autowired
    private PoAttributeMapper poAttributeMapper;
    @Autowired
    private PoFileOutputServiceImpl poFileOutputService;

    @Override
    public void savePoExcelData(CommonsMultipartFile file, HttpServletRequest request) {
        List<PoAttributeDO> poAttributeDOS = poFileOutputService.getPoListByExcleImport(file, request);
        if (poAttributeDOS != null) {
            poAttributeMapper.batchSavePoExcelDetails(poAttributeDOS);
        }
    }
}
